import React, { useState ,useEffect } from 'react';

export default function Example() {
  // Declare a new state variable, which we'll call "count"
  const [count, setCount] = useState({
    name:"liu",
    age:20
  });
  useEffect(()=>{
    document.title = `You clicked ${count} times`;
  })
  return (
    <div>
      <p>You clicked {count.name} times</p>
      <button onClick={() => setCount(count.name="zhang")}>
        Click me
      </button>
    </div>
  );
}



